; *** Go
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com

(version "2.0")

; Future consideration:
; It would best if Mini-Go were played where a draw means the second player wins

(define adjacent-to
	(or
		(position-flag? $1 n)
		(position-flag? $1 s)
		(position-flag? $1 e)
		(position-flag? $1 w)
	)
)
(define set-danger-flag 
	(if (and (enemy? $1) (not-position-flag? safe $1))
		(set-position-flag danger true $1)
		(set-flag Changed true)
	)
)

(define Board-Definition4x4
        (image "images\Mini-Go\Shaag\MiniGo4x4.bmp" "images\Mini-Go\MiniGo4x4.bmp")
        (grid
            (start-rectangle 33 35 103 105) ; top-left position
            (dimensions ;4x4
                ("a/b/c/d" (90 0)) ; columns
                ("4/3/2/1" (0 90)) ; rows
            )
			(directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
		)
        (positions (end -100 -100 -99 -99))
		(links next (a1 a2) (a2 a3) (a3 a4) (a4 b1) (b1 b2) (b2 b3) (b3 b4) (b4 c1)
                    (c1 c2) (c2 c3) (c3 c4) (c4 d1) (d1 d2) (d2 d3) (d3 d4) (d4 end))
)

(define Board-Definition19x19
        (image "images\Go-Moku\GomokuLg.bmp")
        (grid
            (start-rectangle 9 9 27 27)
            (dimensions
	   ("A/B/C/D/E/F/G/H/J/K/L/M/N/O/P/Q/R/S/T" (18 0)) ; columns
	   ("19/18/17/16/15/14/13/12/11/10/9/8/7/6/5/4/3/2/1" (0 18))) ; rows
            (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
        )
        (positions (end -100 -100 -99 -99))
       (links next
        (A1 A2) (A2 A3) (A3 A4) (A4 A5) (A5 A6) (A6 A7) (A7 A8) (A8 A9) (A9 A10) (A10 A11) (A11 A12) (A12 A13) (A13 A14) (A14 A15) (A15 A16) (A16 A17) (A17 A18) (A18 A19) (A19 B1) 
        (B1 B2) (B2 B3) (B3 B4) (B4 B5) (B5 B6) (B6 B7) (B7 B8) (B8 B9) (B9 B10) (B10 B11) (B11 B12) (B12 B13) (B13 B14) (B14 B15) (B15 B16) (B16 B17) (B17 B18) (B18 B19) (B19 C1) 
        (C1 C2) (C2 C3) (C3 C4) (C4 C5) (C5 C6) (C6 C7) (C7 C8) (C8 C9) (C9 C10) (C10 C11) (C11 C12) (C12 C13) (C13 C14) (C14 C15) (C15 C16) (C16 C17) (C17 C18) (C18 C19) (C19 D1) 
        (D1 D2) (D2 D3) (D3 D4) (D4 D5) (D5 D6) (D6 D7) (D7 D8) (D8 D9) (D9 D10) (D10 D11) (D11 D12) (D12 D13) (D13 D14) (D14 D15) (D15 D16) (D16 D17) (D17 D18) (D18 D19) (D19 E1) 
        (E1 E2) (E2 E3) (E3 E4) (E4 E5) (E5 E6) (E6 E7) (E7 E8) (E8 E9) (E9 E10) (E10 E11) (E11 E12) (E12 E13) (E13 E14) (E14 E15) (E15 E16) (E16 E17) (E17 E18) (E18 E19) (E19 F1) 
        (F1 F2) (F2 F3) (F3 F4) (F4 F5) (F5 F6) (F6 F7) (F7 F8) (F8 F9) (F9 F10) (F10 F11) (F11 F12) (F12 F13) (F13 F14) (F14 F15) (F15 F16) (F16 F17) (F17 F18) (F18 F19) (F19 G1) 
        (G1 G2) (G2 G3) (G3 G4) (G4 G5) (G5 G6) (G6 G7) (G7 G8) (G8 G9) (G9 G10) (G10 G11) (G11 G12) (G12 G13) (G13 G14) (G14 G15) (G15 G16) (G16 G17) (G17 G18) (G18 G19) (G19 H1) 
        (H1 H2) (H2 H3) (H3 H4) (H4 H5) (H5 H6) (H6 H7) (H7 H8) (H8 H9) (H9 H10) (H10 H11) (H11 H12) (H12 H13) (H13 H14) (H14 H15) (H15 H16) (H16 H17) (H17 H18) (H18 H19) (H19 J1) 
        (J1 J2) (J2 J3) (J3 J4) (J4 J5) (J5 J6) (J6 J7) (J7 J8) (J8 J9) (J9 J10) (J10 J11) (J11 J12) (J12 J13) (J13 J14) (J14 J15) (J15 J16) (J16 J17) (J17 J18) (J18 J19) (J19 K1) 
        (K1 K2) (K2 K3) (K3 K4) (K4 K5) (K5 K6) (K6 K7) (K7 K8) (K8 K9) (K9 K10) (K10 K11) (K11 K12) (K12 K13) (K13 K14) (K14 K15) (K15 K16) (K16 K17) (K17 K18) (K18 K19) (K19 L1) 
        (L1 L2) (L2 L3) (L3 L4) (L4 L5) (L5 L6) (L6 L7) (L7 L8) (L8 L9) (L9 L10) (L10 L11) (L11 L12) (L12 L13) (L13 L14) (L14 L15) (L15 L16) (L16 L17) (L17 L18) (L18 L19) (L19 M1) 
        (M1 M2) (M2 M3) (M3 M4) (M4 M5) (M5 M6) (M6 M7) (M7 M8) (M8 M9) (M9 M10) (M10 M11) (M11 M12) (M12 M13) (M13 M14) (M14 M15) (M15 M16) (M16 M17) (M17 M18) (M18 M19) (M19 N1) 
        (N1 N2) (N2 N3) (N3 N4) (N4 N5) (N5 N6) (N6 N7) (N7 N8) (N8 N9) (N9 N10) (N10 N11) (N11 N12) (N12 N13) (N13 N14) (N14 N15) (N15 N16) (N16 N17) (N17 N18) (N18 N19) (N19 O1) 
        (O1 O2) (O2 O3) (O3 O4) (O4 O5) (O5 O6) (O6 O7) (O7 O8) (O8 O9) (O9 O10) (O10 O11) (O11 O12) (O12 O13) (O13 O14) (O14 O15) (O15 O16) (O16 O17) (O17 O18) (O18 O19) (O19 P1) 
        (P1 P2) (P2 P3) (P3 P4) (P4 P5) (P5 P6) (P6 P7) (P7 P8) (P8 P9) (P9 P10) (P10 P11) (P11 P12) (P12 P13) (P13 P14) (P14 P15) (P15 P16) (P16 P17) (P17 P18) (P18 P19) (P19 Q1) 
        (Q1 Q2) (Q2 Q3) (Q3 Q4) (Q4 Q5) (Q5 Q6) (Q6 Q7) (Q7 Q8) (Q8 Q9) (Q9 Q10) (Q10 Q11) (Q11 Q12) (Q12 Q13) (Q13 Q14) (Q14 Q15) (Q15 Q16) (Q16 Q17) (Q17 Q18) (Q18 Q19) (Q19 R1) 
        (R1 R2) (R2 R3) (R3 R4) (R4 R5) (R5 R6) (R6 R7) (R7 R8) (R8 R9) (R9 R10) (R10 R11) (R11 R12) (R12 R13) (R13 R14) (R14 R15) (R15 R16) (R16 R17) (R17 R18) (R18 R19) (R19 S1) 
        (S1 S2) (S2 S3) (S3 S4) (S4 S5) (S5 S6) (S6 S7) (S7 S8) (S8 S9) (S9 S10) (S10 S11) (S11 S12) (S12 S13) (S13 S14) (S14 S15) (S15 S16) (S16 S17) (S17 S18) (S18 S19) (S19 T1) 
        (T1 T2) (T2 T3) (T3 T4) (T4 T5) (T5 T6) (T6 T7) (T7 T8) (T8 T9) (T9 T10) (T10 T11) (T11 T12) (T12 T13) (T13 T14) (T14 T15) (T15 T16) (T16 T17) (T17 T18) (T18 T19) (T19 end)
       )
)    

(define Board-Definition13x13
        (image "images\Mini-Go\Shaag\13x13.bmp")
        (grid
            (start-rectangle 9 9 27 27)
            (dimensions
	   ("A/B/C/D/E/F/G/H/J/K/L/M/N" (18 0)) ; columns
	   ("13/12/11/10/9/8/7/6/5/4/3/2/1" (0 18))) ; rows
            (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
       )
(positions (end -100 -100 -99 -99))
       (links next
        (A1 A2) (A2 A3) (A3 A4) (A4 A5) (A5 A6) (A6 A7) (A7 A8) (A8 A9) (A9 A10) (A10 A11) (A11 A12) (A12 A13) (A13 B1) 
        (B1 B2) (B2 B3) (B3 B4) (B4 B5) (B5 B6) (B6 B7) (B7 B8) (B8 B9) (B9 B10) (B10 B11) (B11 B12) (B12 B13) (B13 C1) 
        (C1 C2) (C2 C3) (C3 C4) (C4 C5) (C5 C6) (C6 C7) (C7 C8) (C8 C9) (C9 C10) (C10 C11) (C11 C12) (C12 C13) (C13 D1) 
        (D1 D2) (D2 D3) (D3 D4) (D4 D5) (D5 D6) (D6 D7) (D7 D8) (D8 D9) (D9 D10) (D10 D11) (D11 D12) (D12 D13) (D13 E1) 
        (E1 E2) (E2 E3) (E3 E4) (E4 E5) (E5 E6) (E6 E7) (E7 E8) (E8 E9) (E9 E10) (E10 E11) (E11 E12) (E12 E13) (E13 F1) 
        (F1 F2) (F2 F3) (F3 F4) (F4 F5) (F5 F6) (F6 F7) (F7 F8) (F8 F9) (F9 F10) (F10 F11) (F11 F12) (F12 F13) (F13 G1) 
        (G1 G2) (G2 G3) (G3 G4) (G4 G5) (G5 G6) (G6 G7) (G7 G8) (G8 G9) (G9 G10) (G10 G11) (G11 G12) (G12 G13) (G13 H1) 
        (H1 H2) (H2 H3) (H3 H4) (H4 H5) (H5 H6) (H6 H7) (H7 H8) (H8 H9) (H9 H10) (H10 H11) (H11 H12) (H12 H13) (H13 J1) 
        (J1 J2) (J2 J3) (J3 J4) (J4 J5) (J5 J6) (J6 J7) (J7 J8) (J8 J9) (J9 J10) (J10 J11) (J11 J12) (J12 J13) (J13 K1) 
        (K1 K2) (K2 K3) (K3 K4) (K4 K5) (K5 K6) (K6 K7) (K7 K8) (K8 K9) (K9 K10) (K10 K11) (K11 K12) (K12 K13) (K13 L1) 
        (L1 L2) (L2 L3) (L3 L4) (L4 L5) (L5 L6) (L6 L7) (L7 L8) (L8 L9) (L9 L10) (L10 L11) (L11 L12) (L12 L13) (L13 M1) 
        (M1 M2) (M2 M3) (M3 M4) (M4 M5) (M5 M6) (M6 M7) (M7 M8) (M8 M9) (M9 M10) (M10 M11) (M11 M12) (M12 M13) (M13 N1) 
        (N1 N2) (N2 N3) (N3 N4) (N4 N5) (N5 N6) (N6 N7) (N7 N8) (N8 N9) (N9 N10) (N10 N11) (N11 N12) (N12 N13) (N13 end) 
       )
)

(define Board-Definition9x9
        (image "images\Mini-Go\Shaag\9x9.bmp")
        (grid
            (start-rectangle 9 9 27 27)
            (dimensions
	          ("A/B/C/D/E/F/G/H/J" (18 0)) ; columns
	          ("9/8/7/6/5/4/3/2/1" (0 18))) ; rows
            (directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
        )
        (positions (end -100 -100 -99 -99))
        (links next
           (A1 A2) (A2 A3) (A3 A4) (A4 A5) (A5 A6) (A6 A7) (A7 A8) (A8 A9) (A9 B1) 
           (B1 B2) (B2 B3) (B3 B4) (B4 B5) (B5 B6) (B6 B7) (B7 B8) (B8 B9) (B9 C1) 
           (C1 C2) (C2 C3) (C3 C4) (C4 C5) (C5 C6) (C6 C7) (C7 C8) (C8 C9) (C9 D1) 
           (D1 D2) (D2 D3) (D3 D4) (D4 D5) (D5 D6) (D6 D7) (D7 D8) (D8 D9) (D9 E1) 
           (E1 E2) (E2 E3) (E3 E4) (E4 E5) (E5 E6) (E6 E7) (E7 E8) (E8 E9) (E9 F1) 
           (F1 F2) (F2 F3) (F3 F4) (F4 F5) (F5 F6) (F6 F7) (F7 F8) (F8 F9) (F9 G1) 
           (G1 G2) (G2 G3) (G3 G4) (G4 G5) (G5 G6) (G6 G7) (G7 G8) (G8 G9) (G9 H1) 
           (H1 H2) (H2 H3) (H3 H4) (H4 H5) (H5 H6) (H6 H7) (H7 H8) (H8 H9) (H9 J1) 
           (J1 J2) (J2 J3) (J3 J4) (J4 J5) (J5 J6) (J6 J7) (J7 J8) (J8 J9) (J9 end) 
        )
)

(define PiecesLarge
    (name Stone)
    (image Black "images\Mini-Go\Shaag\BigBlackStone.bmp" "images\Mini-Go\BigBlackStone.bmp"
            White "images\Mini-Go\Shaag\BigWhiteStone.bmp" "images\Mini-Go\BigWhiteStone.bmp")
    (help "Stone: drops on any empty square")
    (drops (
	  (verify empty?)
	  (verify (not-position? end))

      (set-flag Capturing false)

      ; if next to enemy
      (if (or (enemy? n)(enemy? s)(enemy? e)(enemy? w))
        mark

;   *** Initialize safe
;   for each point
;     if enemy
;       if next to empty
;         P[safe] = true

        a1
        (while (not-position? end)
          (set-position-flag safe empty?)
          next
        )
		back
		(set-position-flag safe false)

        a1
        (while (not-position? end)
          (if (and enemy? (adjacent-to safe))
            (set-position-flag safe true)
          )
          next
        )

;   *** Initialize danger
;   for each adjacent
;     if enemy
;       P[danger] = true

        back
        (set-flag Changed false)
        (set-danger-flag n)
        (set-danger-flag s)
        (set-danger-flag e)
        (set-danger-flag w)
        (if (flag? Changed)

;   *** Spread danger, safe
;   Changed = true
;   while Changed
;     Changed = false
;     for each point
;       if enemy
;         if !P[safe]
;           if any adjacent is enemy with P[safe]
;             P[safe] = true
;         if !P[safe] and !P[danger]
;           if any adjacent is enemy with P[danger]
;             P[danger] = true
;             Changed = true

          (while (flag? Changed)
            (set-flag Changed false)
            a1
            (while (not-position? end)
              (if enemy?
                (if (and (not-position-flag? safe) (adjacent-to safe))
                  (set-position-flag safe true)
				  (set-flag Changed true)
                )
                (if (and (not-position-flag? safe)
                         (not-position-flag? danger)
                         (adjacent-to danger)
                    )
                  (set-position-flag danger true)
                  (set-flag Changed true)
                )
              )
              next
            )
          )

;   *** Add captures for stones
;   for each point
;     if P[danger] and !P[safe]
;       capture

          a1
          (while (not-position? end)
            (if (and (position-flag? danger) (not-position-flag? safe))
              capture
			  (set-flag Capturing true)
            )
            next
          )

          back
        ) ; if Changed
      ) ; if next to enemy


;!!!!!!! Find out if suicide

;   if no captures

      (if (and (not-flag? Capturing)
               (not (or (empty? n) (empty? s) (empty? e) (empty? w)))
          )

;   *** Initialize safe
;     for each point
;       P[safe] = empty and not-marked

        a1
        (while (not-position? end)
          (set-position-flag safe empty?)
          next
        )
        back
        (set-position-flag safe false)

;     Changed = true
;     while Changed and not adjacent to safe
;       Changed = false
;       for each point
;         if friend
;           if !P[safe]
;             if any adjacent is friend with P[safe]
;               P[safe] = true
;               Changed = true

        (set-flag Valid (adjacent-to safe))
        (set-flag Changed true)
        (while (and (not-flag? Valid) (flag? Changed))
          (set-flag Changed false)
            a1
          (while (not-position? end)
            (if (and friend? (not-position-flag? safe))
              (if (adjacent-to safe)
                (set-position-flag safe true)
                (set-flag Changed true)
              )
            )
            next
          )
          back
          (set-flag Valid (adjacent-to safe))
        )

;   *** Add if not suicide
;     verify next to safe square

        back
        (verify (flag? Valid))

      ) ; if no captures

; *** Add stone
      add
    )) ; drops
)

(define PiecesSmall
    (name Stone)
    (image  Black "images\Go-Moku\GoStoneB17.bmp" "images\Go-Moku\GoStoneB.bmp"
               White "images\Go-Moku\GoStoneW17.bmp" "images\Go-Moku\GoStoneW.bmp")
    (help "Stone: drops on any empty square")
    (drops 
;((verify friend?) add)
            (
	  (verify empty?)
	  (verify (not-position? end))

      (set-flag Capturing false)

      ; if next to enemy
      (if (or (enemy? n)(enemy? s)(enemy? e)(enemy? w))
        mark

;   *** Initialize safe
;   for each point
;     if enemy
;       if next to empty
;         P[safe] = true

        A1
        (while (not-position? end)
          (set-position-flag safe empty?)
          next
        )
		back
		(set-position-flag safe false)

        A1
        (while (not-position? end)
          (if (and enemy? (adjacent-to safe))
            (set-position-flag safe true)
          )
          next
        )

;   *** Initialize danger
;   for each adjacent
;     if enemy
;       P[danger] = true

        back
        (set-flag Changed false)
        (set-danger-flag n)
        (set-danger-flag s)
        (set-danger-flag e)
        (set-danger-flag w)
        (if (flag? Changed)

;   *** Spread danger, safe
;   Changed = true
;   while Changed
;     Changed = false
;     for each point
;       if enemy
;         if !P[safe]
;           if any adjacent is enemy with P[safe]
;             P[safe] = true
;         if !P[safe] and !P[danger]
;           if any adjacent is enemy with P[danger]
;             P[danger] = true
;             Changed = true

          (while (flag? Changed)
            (set-flag Changed false)
            A1
            (while (not-position? end)
              (if enemy?
                (if (and (not-position-flag? safe) (adjacent-to safe))
                  (set-position-flag safe true)
				  (set-flag Changed true)
                )
                (if (and (not-position-flag? safe)
                         (not-position-flag? danger)
                         (adjacent-to danger)
                    )
                  (set-position-flag danger true)
                  (set-flag Changed true)
                )
              )
              next
            )
          )

;   *** Add captures for stones
;   for each point
;     if P[danger] and !P[safe]
;       capture

          A1
          (while (not-position? end)
            (if (and (position-flag? danger) (not-position-flag? safe))
              capture
			  (set-flag Capturing true)
            )
            next
          )

          back
        ) ; if Changed
      ) ; if next to enemy


;!!!!!!! Find out if suicide

;   if no captures

      (if (and (not-flag? Capturing)
               (not (or (empty? n) (empty? s) (empty? e) (empty? w)))
          )

;   *** Initialize safe
;     for each point
;       P[safe] = empty and not-marked

        A1
        (while (not-position? end)
          (set-position-flag safe empty?)
          next
        )
        back
        (set-position-flag safe false)

;     Changed = true
;     while Changed and not adjacent to safe
;       Changed = false
;       for each point
;         if friend
;           if !P[safe]
;             if any adjacent is friend with P[safe]
;               P[safe] = true
;               Changed = true

        (set-flag Valid (adjacent-to safe))
        (set-flag Changed true)
        (while (and (not-flag? Valid) (flag? Changed))
          (set-flag Changed false)
            A1
          (while (not-position? end)
            (if (and friend? (not-position-flag? safe))
              (if (adjacent-to safe)
                (set-position-flag safe true)
                (set-flag Changed true)
              )
            )
            next
          )
          back
          (set-flag Valid (adjacent-to safe))
        )

;   *** Add if not suicide
;     verify next to safe square

        back
        (verify (flag? Valid))

      ) ; if no captures

; *** Add stone
      add
    )) ; drops
)

(game
    (title "4路围棋")
	(description "黑白双方交替下子，每次下一子，落于交叉点位置。\
若一个或一片棋子被完全围住，即没有“气”，那这些棋子被提走。\
占据棋盘较多的一方获胜。\
理论上，最小的围棋应该是4路。本游戏提供了4路、9路、13路、19路等多种玩法。")
	(history "Most of the accounts of Go's invention are shrouded
	 in myths, which suggest the game to have been invented in
	 China, where it is known as `wei chi`, perhaps 4000 years ago.
	 References from Chinese literature indicate that the game was
	 popular in China in the 6th century B.C., and appears to have
	 been introduced into Japan in the 7th century A.D.  By this
	 time the present board size of 19x19 had already been established,
	 although a smaller 17x17 board may still be in use today among
	 nobility in the Himalayas.  Go is mentioned in Murasaki Shikibu's
	 11th century novel `The Tale of Genji`, and the earliest game of
	 which a record has survived was played in 1253.\\
	 Go also spread to Korea and other countries in the Far East,
	 and professional organizations flourish in Japan, China, and Korea,
	 with tournaments, ranking systems, and lucrative prize money.
	 The game has been slower to gain popularity in the West, but there
	 are many strong amateur players in Europe and North America.
	 Books, magazines, and newspaper articles are plentiful in the
	 East, and the amount of material available in English is gradually
	 increasing. (see <http://www.zillions-of-games.com/go.html>")
	(strategy "In order for a group of stones to be `alive` (safe from
	 capture, it must form two eyes (empty points surrounded by
	 friendly stones).   Opening play starts near the corners (where
	 it is easier to surround territory), and develops along the
	 sides of the board, gradually breaking into the center in the
	 middle game.  Important elements of strategy include tactical
	 maneuvers (`tesuji`), initiative (`sente`), and determining
	 whether groups of stones can be captured or not (`life and death`).")
    (option "animate drops" false)
    (drop-sound "Audio\\Click2.wav")
    (capture-sound "Audio\\WoodBlock.wav")
    (option "pass turn" true)
    (players Black White)
    (turn-order Black White)
    (board (Board-Definition4x4))
    (piece (PiecesLarge))
    (board-setup
        (Black (Stone off 99))
        (White (Stone off 99))
    )
    (count-condition (Black White) stalemated)
    (loss-condition (Black White) repetition)
) ; game


(variant
   (title "-") ; --------------------------------------------------------
)

(variant
    (title "9路围棋")
	(engine "Engines\GoEngine.dll")
	(board (Board-Definition9x9))
    (piece (PiecesSmall))
)

(variant
    (title "9路围棋-让2子")
	(engine "Engines\GoEngine.dll")
	(turn-order White Black)
	(board (Board-Definition9x9))
    (piece (PiecesSmall))
	(board-setup
        (Black (Stone off 400 G7 C3))
        (White (Stone off 400))
	)   
)

(variant
    (title "9路围棋-让3子")
	(engine "Engines\GoEngine.dll")
	(turn-order White Black)
    (board (Board-Definition9x9))
    (piece (PiecesSmall))
	(board-setup
        (Black (Stone off 400 G7 C3 G3))
        (White (Stone off 400))
	)
    
)

(variant
    (title "9路围棋-让4子")
	(engine "Engines\GoEngine.dll")
	(turn-order White Black)
    (board (Board-Definition9x9))
    (piece (PiecesSmall))
	(board-setup
        (Black (Stone off 400 G7 C3 G3 C7))
        (White (Stone off 400))
	)   
)

(variant
    (title "9路围棋-让5子")
	(engine "Engines\GoEngine.dll")
    (board (Board-Definition9x9))
    (piece (PiecesSmall))
	(turn-order White Black)
	(board-setup
        (Black (Stone off 400 G7 C3 G3 C7 E5))
        (White (Stone off 400))
	)    
)

(variant
   (title "-") ; --------------------------------------------------------
)

(variant
    (title "13路围棋")
	(engine "Engines\GoEngine.dll")
	(board (Board-Definition13x13))
    (piece (PiecesSmall))
)


(variant
    (title "13路围棋-让2子")
	(engine "Engines\GoEngine.dll")
	(board (Board-Definition13x13))
    (piece (PiecesSmall))
	(turn-order White Black)
	(board-setup
        (Black (Stone off 400 K10 D4))
        (White (Stone off 400))
	)
)


(variant
    (title "13路围棋-让3子")
	(engine "Engines\GoEngine.dll")
	(board (Board-Definition13x13))
    (piece (PiecesSmall))
	(turn-order White Black)
	(board-setup
        (Black (Stone off 400 K10 D4 K4))
        (White (Stone off 400))
	)
    
)

(variant
    (title "13路围棋-让4子")
	(engine "Engines\GoEngine.dll")
	(board (Board-Definition13x13))
    (piece (PiecesSmall))
	(turn-order White Black)
	(board-setup
        (Black (Stone off 400 K10 D4 K4 D10))
        (White (Stone off 400))
	)
)

(variant
    (title "13路围棋-让5子")
	(engine "Engines\GoEngine.dll")
	(board (Board-Definition13x13))
    (piece (PiecesSmall))
	(turn-order White Black)
	(board-setup
        (Black (Stone off 400 K10 D4 K4 D10 G7))
        (White (Stone off 400))
	)
)

(variant
   (title "-") ; --------------------------------------------------------
)


(variant
    (title "19路围棋")
    (engine "Engines\GoEngine.dll")
    (board (Board-Definition19x19))
    (default)
    (piece (PiecesSmall))
    (board-setup
        (Black (Stone off 400))
        (White (Stone off 400))
	)

;    (count-condition (Black White) stalemated)
;    (loss-condition (Black White) repetition)

 
)

(variant
    (title "19路围棋-让2子")
	(engine "Engines\GoEngine.dll")
	(turn-order White Black)
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	 (board-setup
        (Black (Stone off 400 Q16 D4))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让3子")
	(turn-order White Black)
	(engine "Engines\GoEngine.dll")
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让4子")
	(engine "Engines\GoEngine.dll")
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	(turn-order White Black)
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4 D16))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让5子")
	(turn-order White Black)
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	(engine "Engines\GoEngine.dll")
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4 D16 K10))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让6子")
	(turn-order White Black)
	(engine "Engines\GoEngine.dll")
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4 D16 D10 Q10))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让7子")
	(turn-order White Black)
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	(engine "Engines\GoEngine.dll")
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4 D16 D10 Q10 K10))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让8子")
	(engine "Engines\GoEngine.dll")
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	(turn-order White Black)
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4 D16 D10 Q10 K16 K4))
        (White (Stone off 400))
	)
)

(variant
    (title "19路围棋-让9子")
	(engine "Engines\GoEngine.dll")
    (board (Board-Definition19x19))
    (piece (PiecesSmall))
	(turn-order White Black)
	 (board-setup
        (Black (Stone off 400 Q16 D4 Q4 D16 D10 Q10 K16 K4 K10))
        (White (Stone off 400))
	)
)